package pers.cnzdy.tutorial.Chapter5_UI.Section7_ListView;

import android.util.Log;

import java.util.ArrayList;
import java.util.List;

import pers.cnzdy.tutorial.R;

import static android.content.ContentValues.TAG;


public class QuizTypes {
    private List<QuizType> quizTypeList = new ArrayList<QuizType>();

    public QuizTypes()
    {
        initQuizTypes();
    }

    public List<QuizType> getQuizTypeList() {
        return quizTypeList;
    }

    private void initQuizTypes() {
        QuizType multiChoice  = new QuizType("选择题", R.drawable.ic_multichoice);
        QuizType trueOrFalse  = new QuizType("判断题", R.drawable.ic_trueorfalse);
        QuizType BlankFilling = new QuizType("填空题", R.drawable.ic_blankfilling);
        QuizType correction   = new QuizType("改错题", R.drawable.ic_correction);
        QuizType shortAnswer  = new QuizType("简答题", R.drawable.ic_shortanswer);
        QuizType calculation  = new QuizType("计算题", R.drawable.ic_calculation);
        QuizType program      = new QuizType("编程题", R.drawable.ic_program);


        quizTypeList.add(multiChoice);
        quizTypeList.add(trueOrFalse);
        quizTypeList.add(BlankFilling);
        quizTypeList.add(correction);
        quizTypeList.add(shortAnswer);
        quizTypeList.add(calculation);
        quizTypeList.add(program);
    }

    public class QuizType {
        String  type;
        int     imageID;      // 在ListView中显示的图片ID号

        public QuizType(String type, int imageID) {
            this.type = type;
            this.imageID = imageID;
        }

        public int getImageID() {
            return imageID;
        }

        public String getType() {
            return type;
        }
    }
}
